<?php

// $Id$

require_once(TANGRA_MAIN_DIR.'form/fields/text/form_field_text_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/fields/checkbox/form_field_checkbox_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/guardable_form_view.class.php');


class VPT_SA_Form_View extends Guardable_Form_View {
	function __construct(Form &$form) {
		parent::__construct($form);

		$f_sa_name = $form->get_field('sa_name');
		$f_sa_name_view = new Form_Field_Text_View($form->get_name().'_'.$f_sa_name->get_name(), $f_sa_name);
		$this->add_field_view('sa_name', $f_sa_name_view);

		$f_required = $form->get_field('required');
		$f_required_view = new Form_Field_Checkbox_View($form->get_name().'_'.$f_required->get_name(), $f_required);
		$this->add_field_view('required', $f_required_view);

		$f_export_name = $form->get_field('export_name');
		$f_export_name_view = new Form_Field_Text_View($form->get_name().'_'.$f_export_name->get_name(), $f_export_name);
		$this->add_field_view('export_name', $f_export_name_view);

		$f_default_value = $form->get_field('default_value');
		$f_default_value_view = new Form_Field_Text_View($form->get_name().'_'.$f_default_value->get_name(), $f_default_value);
		$this->add_field_view('default_value', $f_default_value_view);

		$f_export = $form->get_field('export');
		$f_export_view = new Form_Field_Checkbox_View($form->get_name().'_'.$f_export->get_name(), $f_export);
		$this->add_field_view('export', $f_export_view);
	}
}